﻿using System;
using DevExpress.XtraEditors;
using EkStudio.com.bean.xml.WorkFlow.Node;

namespace EkStudio.com.ui.unitbill.WorkFlow
{
    public partial class FlowTaskNode : XtraUserControl,UiNode
    {

        private WflowModuleNodeItem bean = null;
        public event NodeClickHandle NodeClickEvent = null;
        public FlowTaskNode(WflowModuleNodeItem it)
        {
            InitializeComponent();
            NodeItem = it;
            Tag = it;
        }


        public WflowModuleNodeItem NodeItem
        {
            get { return bean; }
            set { bean = value;LabelCaption.Text = bean.Caption; }
        }

        public string NodeCaption
        {
            get { return bean != null ? bean.Caption : "审批节点"; }
            set { LabelCaption.Text = value; }
        }

        private void pictureBox1_Click(object sender, System.EventArgs e)
        {
            if (NodeClickEvent != null)
            {
                NodeClickEvent(this, bean);
            }
        }

        private void FlowTaskNode_Click(object sender, System.EventArgs e)
        {
            if (NodeClickEvent != null)
            {
                NodeClickEvent(this, bean);
            }
        }

        private void LabelCaption_Click(object sender, System.EventArgs e)
        {
            if (NodeClickEvent != null)
            {
                NodeClickEvent(this, bean);
            }
        }
    }
}
